/*
 * @Description: 每周食品安全检查
 * @Author: mengjiajun
 * @Date: 2023-12-25 10:57:24
 * @LastEditors: mengjiajun
 * @LastEditTime: 2023-12-27 16:47:19
 * @FilePath: \foodstuff-safety-responsibility\src\pages\IntelFilling\components\WeekReport\index.tsx
 */

import { useState } from "react";
import Taro from "@tarojs/taro";
import { Button, Tab, Tabs } from "@antmjs/vantui";
import { View } from "@tarojs/components";
import DraftsList from "./components/DraftsList";
import SubmittedList from "./components/SubmittedList";
import "./index.less";

const WeekReport: React.FC = () => {
  const [curActive, setCurActive] = useState(0);
  return (
    <View className="w-full h-[100vh] p-2 flex flex-col gap-2 weekReportClass">
      <Tabs
        animated
        className="flex-1 w-full"
        active={curActive}
        onChange={(e) => {
          setCurActive(e.detail.index);
        }}
      >
        <Tab title="草稿箱">
          <DraftsList />
        </Tab>
        <Tab title="已提交">
          <SubmittedList />
        </Tab>
      </Tabs>
      {curActive === 0 ? (
        <Button
          type="info"
          className="w-full"
          onClick={() => {
            Taro.navigateTo({
              url: "/pages/IntelFilling/components/WeekReport/components/FillingGuide/index",
            });
          }}
        >
          点击开始排查
        </Button>
      ) : null}
    </View>
  );
};

export default WeekReport;
